﻿#region 程序集引用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Zhang.key;

#endregion

namespace Zhang
{
    namespace AdminPage
    {
        /// <summary>
        /// 平台管理中心异步处理基类 Controller
        /// </summary>
        public class AjaxBaseController : System.Web.Mvc.Controller
        {
            /// <summary>
            /// 当前页面功能名称
            /// </summary>
            protected string ModelName
            {
                get;
                set;
            }

            public bool IsReusable
            {
                get { return true; }
            }

            /// <summary>
            /// 是否已登陆  True 已登陆  False 登陆超时或未登陆
            /// </summary>
            /// <param name="context"></param>
            /// <returns></returns>
            public bool IsLogin
            {
                get
                {
                    if (Session[SessionKey.ADMIN_USER_INFORMATION] != null)
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
                }
            }

            /// <summary>
            /// 用户登陆信息
            /// </summary>
            public Model.AdminUser UserInfo
            {
                get
                {
                    return Session[SessionKey.ADMIN_USER_INFORMATION] as Model.AdminUser;
                }
            }

         
          

            ///// <summary>
            ///// 页面级错误处理
            ///// </summary>
            ///// <param name="sender"></param>
            ///// <param name="e"></param>
            //protected void WriteExpLog(Exception ex)
            //{
            //    //IDALFactory.CommonAccess.Log().ExpInsert(ModelName, "【" + ex.Message + "】" + ex.ToString());
            //    LogHelper.Write(ModelName, "【" + ex.Message + "】" + ex.ToString());//统一到LogHelper
            //    Server.ClearError();
            //}

           
        }
    }
}
